/*******************************************************************

    Author: Xiao
    Date: 2022/3/29 10:09

*******************************************************************/
package dao

type Access struct {
	AccessId  			int 	`gorm:"primarykey"`
	AccessUser			int
	AccessToken 		string
	AccessPlat	 		string
	AccessIp 			string
	AccessStatus 		int
	AccessCreatetime	int64	`gorm:"autoCreateTime"`
	AccessUpdatetime	int64	`gorm:"autoUpdateTime"`
}

// 添加登录信息
func CreateAccess(user int,plat,token,ip string) error{
	a := Access{AccessUser: user, AccessPlat: plat, AccessToken: token,AccessIp: ip}
	result := MDB.Create(&a)
	return result.Error
}